package com.zg.autoflow.web;

import cn.hutool.core.bean.BeanUtil;
import com.zg.autoflow.req.SettleWorkflowStepReq;
import com.zg.autoflow.service.SettleWorkflowStepService;
import com.zg.autoflow.vo.SettleWorkflowStepVo;
import com.zg.common.core.R;
import com.zg.common.core.dao.autoflow.entity.SettleWorkflowStep;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
* @author zg
*/
@Api(tags = {"环节配置"})
@RestController
@RequiredArgsConstructor
public class SettleWorkflowStepController {
	private final SettleWorkflowStepService settleWorkflowStepService;

	@ApiOperation("获取下一环节配置信息")
	@PostMapping("/flow/settleWorkflowStep/getNextStepConfig")
	public R<List<SettleWorkflowStepVo>> getNextStepConfig(@RequestBody SettleWorkflowStepReq settleWorkflowStepReq) {
		List<SettleWorkflowStep> list = settleWorkflowStepService.getNextStepConfig(settleWorkflowStepReq);
		return R.success(BeanUtil.copyToList(list, SettleWorkflowStepVo.class));
	}

}
